﻿namespace NEvoWeb.Modules.NB_Store
{
    using DotNetNuke.Framework;
    using System;
    using System.Data;
    using System.Runtime.InteropServices;
    using System.Web.UI.WebControls;

    public abstract class DataProvider
    {
        private static DataProvider objProvider = null;

        static DataProvider()
        {
            CreateProvider();
        }

        protected DataProvider()
        {
        }

        public abstract void ClearCategory(int CategoryID);
        public abstract void ClearDownStore(int PortalID);
        public abstract void ClearNB_Store_SaleRates(int PortalID, int ModelID);
        private static void CreateProvider()
        {
            objProvider = (DataProvider) Reflection.CreateObject("data", "NEvoWeb.Modules.NB_Store", "");
        }

        public abstract int CheckIfProductPurchased(int ProductID, int UserID);
        public abstract void DeleteNB_Store_Address(int AddressID);
        public abstract void DeleteNB_Store_Cart(string CartID);
        public abstract void DeleteNB_Store_CartItems(int ItemID);
        public abstract void DeleteNB_Store_Categories(int CategoryID);
        public abstract void DeleteNB_Store_Model(int ModelID);
        public abstract void DeleteNB_Store_Option(int OptionID);
        public abstract void DeleteNB_Store_OptionValue(int OptionValueID);
        public abstract void DeleteNB_Store_OrderAction(int OrderActionID);
        public abstract void DeleteNB_Store_OrderActions(int OrderActionsID, string Lang);
        public abstract void DeleteNB_Store_OrderDetails(int OrderDetailID);
        public abstract void DeleteNB_Store_Orders(int OrderID);
        public abstract void DeleteNB_Store_OrderStatus(int OrderStatusID, string Lang);
        public abstract void DeleteNB_Store_ProductDoc(int DocID);
        public abstract void DeleteNB_Store_ProductImage(int ImageID);
        public abstract void DeleteNB_Store_ProductRelated(int RelatedID);
        public abstract void DeleteNB_Store_ProductRelatedByProduct(int ProductID);
        public abstract void DeleteNB_Store_Products(int ProductID);
        public abstract void DeleteNB_Store_Promo(int PromoID);
        public abstract void DeleteNB_Store_Reviews(int ReviewID);
        public abstract void DeleteNB_Store_SaleRates(int ItemID);
        public abstract void DeleteNB_Store_Settings(int PortalID, string SettingName, string Lang);
        public abstract void DeleteNB_Store_SettingsText(int PortalID, string SettingName, string Lang);
        public abstract void DeleteNB_Store_ShippingRates(int ItemId);
        public abstract void DeleteNB_Store_Stock(int StockID);
        public abstract void DeleteNB_Store_TaxRates(int ItemID);
        public abstract void DeleteOldCarts(int PortalID, int CartMins, int OrderMins);
        public abstract void DeleteProductCategory(int ProductID, int CategoryID);
        public abstract void DeleteShippingMethod(int ShipMethodID);
        public abstract void DeleteSQLReport(int ReportID);
        public abstract void DeleteSQLReportParam(int ReportParamID);
        public abstract void DeleteSQLReportXSL(int ReportXSLID);
        public abstract IDataReader ExecuteSQL(string SQLcommand);
        public abstract string ExecuteSQLReportText(string SQLcommand, string FieldDelimeter, string FieldQualifier, bool ExportHeader);
        public abstract string ExecuteSQLReportXml(string SQLcommand);
        public abstract int GetCartModelQty(int PortalID, int ModelID, string CartID = "");
        public abstract IDataReader GetModelByRef(int ProductID, string ModelRef, string Lang);
        public abstract int GetModelInOrders(int ModelID);
        public abstract IDataReader GetNB_Store_Address(int AddressID);
        public abstract IDataReader GetNB_Store_Cart(string CartID);
        public abstract IDataReader GetNB_Store_CartItems(int ItemID);
        public abstract IDataReader GetNB_Store_CartItemsByOptCode(string CartID, string OptCode);
        public abstract IDataReader GetNB_Store_CartItemss(string CartID);
        public abstract IDataReader GetNB_Store_CartList(string CartID);
        public abstract IDataReader GetNB_Store_Categories(int CategoryID, string Lang);
        public abstract IDataReader GetNB_Store_CategoriesList(int PortalID, string Lang, int ParentID, bool Archived, bool IncludeArchived);
        public abstract IDataReader GetNB_Store_DeletedModels(int PortalID);
        public abstract IDataReader GetNB_Store_GetUsers(int PortalID, string Filter);
        public abstract IDataReader GetNB_Store_Model(int ModelID, string Lang);
        public abstract IDataReader GetNB_Store_ModelByProductID(int ProductID, string Lang);
        public abstract IDataReader GetNB_Store_Models(int PortalID, int ProductID, string Lang, bool IsDealer);
        public abstract IDataReader GetNB_Store_ModelsInStock(int ProductID, string Lang, bool IsDealer);
        public abstract IDataReader GetNB_Store_ModelStockList(int PortalID, string Filter, string Lang, int CategoryID, int PageIndex, int PageSize, bool IsDealer);
        public abstract int GetNB_Store_ModelStockListSize(int PortalID, string Filter, string Lang, int CategoryID, bool IsDealer);
        public abstract IDataReader GetNB_Store_Option(int OptionID, string Lang);
        public abstract IDataReader GetNB_Store_Options(int ProductID, string Lang);
        public abstract IDataReader GetNB_Store_OptionValue(int OptionValueID, string Lang);
        public abstract IDataReader GetNB_Store_OptionValues(int OptionValueID, string Lang);
        public abstract IDataReader GetNB_Store_OrderAction(int OrderActionID);
        public abstract IDataReader GetNB_Store_OrderActionList(int OrderID);
        public abstract IDataReader GetNB_Store_OrderActions(int OrderActionsID, string Lang);
        public abstract IDataReader GetNB_Store_OrderActionsList(string Lang);
        public abstract IDataReader GetNB_Store_OrderDetails(int OrderDetailID);
        public abstract IDataReader GetNB_Store_OrderDetailss(int OrderID);
        public abstract IDataReader GetNB_Store_Orders(int OrderID);
        public abstract IDataReader GetNB_Store_OrdersByGUID(string OrderGUID);
        public abstract IDataReader GetNB_Store_Orderss(int PortalID, int UsrID, DateTime FromDate, DateTime ToDate, int StatusID, string Filter);
        public abstract IDataReader GetNB_Store_OrderStatus(int OrderStatusID, string Lang);
        public abstract IDataReader GetNB_Store_OrderStatuss(string Lang);
        public abstract IDataReader GetNB_Store_ProductCategoriesAssigned(int ProductID);
        public abstract IDataReader GetNB_Store_ProductDoc(int DocID, string Lang);
        public abstract IDataReader GetNB_Store_ProductDocExportList(int PortalID);
        public abstract IDataReader GetNB_Store_ProductDocList(int ProductID, string Lang);
        public abstract IDataReader GetNB_Store_ProductImage(int ImageID, string Lang);
        public abstract IDataReader GetNB_Store_ProductImages(int ProductID, string Lang);
        public abstract IDataReader GetNB_Store_ProductRelated(int RelatedID);
        public abstract IDataReader GetNB_Store_ProductRelatedList(int PortalID, int ProductID, string Lang, int RelatedType, bool GetAll);
        public abstract IDataReader GetNB_Store_Products(int ProductID, string Lang);
        public abstract IDataReader GetNB_Store_ProductSelectDocList(string Lang, string FilterText, int PortalID);
        public abstract IDataReader GetNB_Store_Productss(int PortalID, int CategoryID, string Lang, string SearchText, bool GetArchived, bool FeaturedOnly, string OrderBY, bool OrderDESC, int ReturnLimit, int PageIndex, int Pagesize, bool SearchDescription, bool isDealer, string CategoryList, bool ExcludeFeatured);
        public abstract IDataReader GetNB_Store_Promo(int PromoID);
        public abstract int GetNB_Store_PromoCodeUsage(int PortalID, string PromoCode);
        public abstract IDataReader GetNB_Store_PromoList(int PortalID, string PromoType, string SearchText, bool GetActiveOnly);
        public abstract IDataReader GetNB_Store_Reviews(int ReviewID);
        public abstract IDataReader GetNB_Store_Reviewss(int ReviewID);
        public abstract IDataReader GetNB_Store_SaleRates(int ItemID);
        public abstract IDataReader GetNB_Store_SaleRatesByCacheKey(string CacheKey);
        public abstract IDataReader GetNB_Store_SaleRatesList(int PortalID, int ModelID);
        public abstract IDataReader GetNB_Store_Settings(int PortalID, string SettingName, string Lang);
        public abstract IDataReader GetNB_Store_Settingss(int PortalID, string Lang, bool IsHost, string SettingName);
        public abstract IDataReader GetNB_Store_SettingsText(int PortalID, string SettingName, string Lang);
        public abstract IDataReader GetNB_Store_SettingsTexts(int PortalID, string Lang, bool IsHost, string SettingName);
        public abstract IDataReader GetNB_Store_ShippingRates(int PortalID, int ItemId);
        public abstract IDataReader GetNB_Store_ShippingRatesByObjID(int PortalID, int ObjectId, string ShipType, int ShipMethodID);
        public abstract IDataReader GetNB_Store_ShippingRatesListByShipMethodID(int PortalID, int ShipMethodID);
        public abstract IDataReader GetNB_Store_ShippingRatess(int PortalID, string ShipType, string Lang, string Filter, int CategoryID, int ShipMethodID);
        public abstract IDataReader GetNB_Store_Stock(int StockID);
        public abstract IDataReader GetNB_Store_Stocks(int StockID);
        public abstract IDataReader GetNB_Store_TaxRates(int PortalID, int ItemID);
        public abstract IDataReader GetNB_Store_TaxRatesByObjID(int PortalID, int ObjectID, string TaxType);
        public abstract IDataReader GetNB_Store_TaxRatess(int PortalID, string TaxType, string Lang, string Filter);
        public abstract IDataReader GetOrdersExportList(int PortalID, int StatusID);
        public abstract IDataReader GetProductByRef(int PortalID, string ProductRef, string Lang);
        public abstract int GetProductCount(int PortalID);
        public abstract IDataReader GetProductExportImages(int PortalID);
        public abstract IDataReader GetProductExportList(int PortalID, string Lang, bool DeletedOnly, string CategoryList);
        public abstract int GetProductInOrders(int ProductID);
        public abstract int GetProductListSize(int PortalID, int CategoryID, string Lang, string SearchText, bool GetArchived, bool FeaturedOnly, bool SearchDescription, bool isDealer, string CategoryList, bool ExcludeFeatured);
        public abstract IDataReader GetShippingMethod(int ShipMethodID);
        public abstract IDataReader GetShippingMethodEnabledList(int PortalID);
        public abstract IDataReader GetShippingMethodList(int PortalID);
        public abstract IDataReader GetSQLAdminReportList(int PortalID, bool IsEditable, string SearchText);
        public abstract IDataReader GetSQLReport(int ReportID);
        public abstract IDataReader GetSQLReportByRef(int PortalID, string ReportRef);
        public abstract IDataReader GetSQLReportParam(int ReportParamID);
        public abstract IDataReader GetSQLReportParamList(int ReportID);
        public abstract IDataReader GetSQLReportXSL(int ReportXSLID);
        public abstract IDataReader GetSQLReportXSLList(int ReportID);
        public static DataProvider Instance()
        {
            return objProvider;
        }

        public abstract void NotAvailableProductRelated(int ProductID, bool Flag);
        public abstract void popDataGridSQL(string SQLcommand, DataGrid GridView);
        public abstract void ProcessSearchWords(int PortalID);
        public abstract void PurgeSearchWord(int PortalID, DateTime PurgeBeforeDate);
        public abstract IDataReader UpdateNB_Store_Address(int AddressID, int PortalID, int UserID, string AddressDescription, string AddressName, string AddressName2, string Address1, string Address2, string City, string RegionCode, string CountryCode, string PostalCode, string Phone1, string Phone2, bool PrimaryAddress, string CreatedByUser, DateTime CreatedDate, int OrderID, string CompanyName, string Extra1, string Extra2, string Extra3, string Extra4);
        public abstract void UpdateNB_Store_Cart(string CartID, int PortalID, int UserID, DateTime DateCreated, int OrderID, string VATNumber, string PromoCode, string CountryCode, string ShipType, int BankTransID, string BankHtmlRedirect, int ShipMethodID, decimal CartDiscount, string XMLInfo, string Referrer);
        public abstract int UpdateNB_Store_CartItems(int ItemID, string CartID, int Quantity, DateTime DateCreated, decimal UnitCost, int ModelID, string OptCode, string ItemDesc, decimal Discount, decimal Tax, string ProductURL, string XMLInfo, bool StaticAmts);
        public abstract IDataReader UpdateNB_Store_Categories(int CategoryID, string Lang, string CategoryName, string CategoryDesc, string Message, int PortalID, bool Archived, string CreatedByUser, DateTime CreatedDate, int ParentCategoryID, int ListOrder, string ProductTemplate, string ListItemTemplate, string ListAltItemTemplate, bool Hide, string ImageURL, string SEOPageTitle, string SEOName, string MetaDescription, string MetaKeywords);
        public abstract int UpdateNB_Store_Model(int ModelID, int ProductID, int ListOrder, decimal AddedCost, string Barcode, string ModelRef, string Lang, string ModelDesc, int QtyRemaining, int QtyTrans, DateTime QtyTransDate, bool Deleted, int QtyStockSet, decimal DealerCost, decimal PurchaseCost, string XMLData, string Extra, bool DealerOnly, int Allow);
        public abstract IDataReader UpdateNB_Store_Option(int OptionID, int ProductID, int ListOrder, string Lang, string OptionDesc, string Attributes);
        public abstract int UpdateNB_Store_OptionValue(int OptionValueID, int OptionID, decimal AddedCost, int ListOrder, string Lang, string OptionValueDesc);
        public abstract void UpdateNB_Store_OrderAction(int OrderActionID, int OrderID, string username, DateTime ActionDate, int OrderActionsID, int OrderStatusID);
        public abstract void UpdateNB_Store_OrderActions(int OrderActionsID, string Lang, string ActionText);
        public abstract void UpdateNB_Store_OrderDetails(int OrderDetailID, int OrderID, int Quantity, decimal UnitCost, int ModelID, string OptCode, string ItemDesc, decimal Discount, decimal Tax, string ProductURL, decimal PurchaseCost, string CartXMLInfo);
        public abstract IDataReader UpdateNB_Store_Orders(int OrderID, int UserID, int PortalID, string OrderNumber, DateTime OrderDate, DateTime ShipDate, int ShippingAddressID, int BillingAddressID, decimal AppliedTax, decimal ShippingCost, bool OrderIsPlaced, int OrderStatusID, string PayType, decimal CalculatedTax, string NoteMsg, string VATNumber, decimal Discount, string PromoCode, decimal Total, string Email, string BankAuthCode, int ShipMethodID, string TrackingCode, string Stg2FormXML, string Stg3FormXML, decimal AlreadyPaid, string OrderGUID, DateTime ElapsedDate, string GatewayProvider, string CartXMLInfo, string Referrer);
        public abstract void UpdateNB_Store_OrderStatus(int OrderStatusID, string Lang, string OrderStatusText, int ListOrder);
        public abstract int UpdateNB_Store_ProductDoc(int DocID, int ProductID, string DocPath, int ListOrder, bool Hidden, string FileName, string FileExt, string Lang, string DocDesc);
        public abstract int UpdateNB_Store_ProductImage(int ImageID, int ProductID, string ImagePath, int ListOrder, bool Hidden, string Lang, string ImageDesc, string ImageURL);
        public abstract void UpdateNB_Store_ProductImageOnly(int ImageID, int ProductID, string ImagePath, int ListOrder, bool Hidden, string ImageURL);
        public abstract int UpdateNB_Store_ProductRelated(int RelatedID, int PortalID, int ProductID, int RelatedProductID, decimal DiscountAmt, decimal DiscountPercent, int ProductQty, int MaxQty, int RelatedType, bool Disabled, bool NotAvailable, bool BiDirectional);
        public abstract IDataReader UpdateNB_Store_Products(int ProductID, int PortalID, int TaxCategoryID, bool Featured, bool Archived, string CreatedByUser, DateTime CreatedDate, bool IsDeleted, string ProductRef, string Lang, string Summary, string Description, string Manufacturer, string ProductName, string XMLData, string SEOName, string TagWords, bool IsHidden);
        public abstract void UpdateNB_Store_Promo(int PromoID, int PortalID, int ObjectID, string PromoName, string PromoType, decimal Range1, decimal Range2, DateTime RangeStartDate, DateTime RangeEndDate, string PromoAmount, int PromoPercent, bool Disabled, string PromoCode, string PromoGroup, string PromoUser, int QtyRange1, int QtyRange2, string PromoEmail, string XMLData, int MaxUsagePerUser, int MaxUsage);
        public abstract void UpdateNB_Store_Reviews(int ReviewID, int PortalID, int ProductID, int UserID, string UserName, int Rating, string Comments, bool Authorized, DateTime CreatedDate);
        public abstract void UpdateNB_Store_SaleRates(int ItemID, string CacheKey, int PortalID, string RoleName, int CategoryID, int ModelID, string SalePrice);
        public abstract void UpdateNB_Store_Settings(int PortalID, string SettingName, string Lang, string SettingValue, bool HostOnly, string GroupRef, string CtrlType);
        public abstract void UpdateNB_Store_SettingsText(int PortalID, string SettingName, string Lang, string SettingText, bool HostOnly, string GroupRef, string CtrlType);
        public abstract void UpdateNB_Store_ShippingRates(int PortalID, int ItemId, decimal Range1, decimal Range2, int ObjectId, decimal ShipCost, string ShipType, bool Disable, string Description, decimal ProductWeight, decimal ProductHeight, decimal ProductLength, decimal ProductWidth, int ShipMethodID);
        public abstract void UpdateNB_Store_Stock(int StockID, int ModelID, int QtyRemaining, int QtyTrans, DateTime QtyTransDate, DateTime ModifiedDate);
        public abstract void UpdateNB_Store_TaxRates(int PortalID, int ItemID, int ObjectID, string TaxPercent, string TaxDesc, string TaxType, bool Disable);
        public abstract void UpdateProductCategory(int ProductID, int CategoryID);
        public abstract void UpdateSearchWord(int PortalID, string SearchWord, int WordPosition);
        public abstract int UpdateShippingMethod(int ShipMethodID, int PortalID, string MethodName, string MethodDesc, int SortOrder, string TemplateName, bool Disabled, string URLtracker, bool Dealer, bool NonDealer);
        public abstract int UpdateSQLReport(int ReportID, int PortalID, string ReportName, string SQL, bool SchedulerFlag, string SchStartHour, string SchStartMins, string SchReRunMins, DateTime LastRunTime, bool AllowExport, bool AllowDisplay, bool DisplayInLine, bool EmailResults, string EmailFrom, string EmailTo, bool ShowSQL, string SQLConnectionString, string ReportRef, bool AllowPaging, string ReportTitle, string FieldDelimeter, string FieldQualifier);
        public abstract void UpdateSQLReportParam(int ReportParamID, int ReportID, string ParamName, string ParamType, string ParamValue, int ParamSource);
        public abstract void UpdateSQLReportXSL(int ReportXSLID, int ReportID, string XMLInput, string XSLFile, string OutputFile, bool DisplayResults, int SortOrder);
    }
}

